-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #730 compatibility with web profiler 4 #735
Conversation
33849d5
to
d77fb48
Compare
a58951d
to
b0fa88d
Compare
"symfony/web-profiler-bundle": "~2.7|~3.0|~4.0" | ||
}, | ||
"conflict": { | ||
"symfony/http-foundation": "<2.6" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
db.html.twig
uses request.query.getBoolean()
. ParameterBag#getBoolean
has been introduced with 2.6
@@ -29,7 +29,7 @@ | |||
"symfony/console": "~2.7|~3.0|~4.0", | |||
"symfony/dependency-injection": "~2.7|~3.0|~4.0", | |||
"doctrine/dbal": "^2.5.12", | |||
"jdorn/sql-formatter": "~1.1", | |||
"jdorn/sql-formatter": "^1.2.16", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DoctrineExtension uses SqlFormatter::$variable_attributes
, introduced with 1.2.16
@@ -39,9 +39,13 @@ | |||
"symfony/validator": "~2.7|~3.0|~4.0", | |||
"symfony/property-info": "~2.8|~3.0|~4.0", | |||
"symfony/phpunit-bridge": "~2.7|~3.0|~4.0", | |||
"twig/twig": "~1.12|~2.0", | |||
"twig/twig": "~1.26|~2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Increased to be able to call Twig_Environment::addRuntimeLoader
in tests. Notice it's require-dev section
.travis.yml
Outdated
|
||
env: | ||
global: | ||
- deps=no | ||
|
||
before_install: | ||
- composer self-update | ||
- if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/symfony:${SYMFONY_VERSION}; fi; | ||
- if [ "$SYMFONY_VERSION" != "" ]; then jq "(.require, .\"require-dev\")|=(with_entries(if .key|test(\"^symfony/\") then .value|=\"${SYMFONY_VERSION}\" else . end))" composer.json|ex -sc 'wq!composer.json' /dev/stdin; fi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old approach replaced to be able to keep paths used in tests in ../vendor/symfony/{component}
format, instead of introducing switches in tests to determine if ../vendor/symfony/symfony/{component}
exists. Simple regex not used to keep conflicts
section without change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much simpler: composer require symfony/lts
(be careful, versions there are just 2 and 3, not 2.8 and 3.4)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, though you already said disadvantages yourself. I would like to keep ability to pick exact symfony version. Other then that, this snippet will provide good example/base for future modifications of composer.json.
b0fa88d
to
370aaa1
Compare
foreach ($this->data['queries'] as &$queries) { | ||
foreach ($queries as &$query) { | ||
// HttpKernel < 3.2 compatibility layer | ||
if (!method_exists($this, 'cloneVar')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't both foreach be inside that if ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
.travis.yml
Outdated
- php: 5.6 | ||
env: SYMFONY_VERSION="2.8.*" | ||
- php: 7.0 | ||
env: SYMFONY_VERSION="3.2.*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't had it. 3.2 is unmaintained
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly true, end of support is in January. Until then we need to make sure it works. If you notice, there are BC layers introduced in my patch and I would like them to get tested.
.travis.yml
Outdated
- php: 7.1 | ||
env: SYMFONY_VERSION="3.4.*@beta" | ||
- php: 7.2 | ||
env: SYMFONY_VERSION="4.0.*@beta" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 for that. This is already covered by the deps=dev
job. I'm only adding version-specific jobs for LTS versions (I don't want to update this config file every 6 months to change the versions, too painful)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which deps=dev? The one for PHP 5.6, which didn't allow to install Symfony 4? The one which was allowed to fail anyway? We can't afford for this bundle to stay incompatible with next Symfony version and figure it out only at RC phase again. These constraints should be set in the way it's clear that something is wrong when tests fail, but on the other side aren't supposed to be expected to fail randomly, which would be the case with dev dependencies. I suggest to have matrix for latest dev=alpha then. That's when failures are starting to be unwanted. But either case, if this line is removed, it means CI won't test against Symfony 4 once Symfony 4.1 is released. I think we should test against each supported minor version though. Thoughts?
@@ -47,6 +47,7 @@ public function process(ContainerBuilder $container) | |||
} | |||
|
|||
$resolver = $container->findDefinition($resolverId); | |||
$resolver->setPublic(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to use a ServiceLocator (by changing the lazy-loading listener resolver) rather than forcing to use public services
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what do you mean, although I don't want to change behaviour. Tests expect this service to be public, meaning having it directly accessible from container. Making it otherwise would be BC break. I have done this change only to fix tests. I think it was concretely this one
$this->assertTrue($container->getDefinition('doctrine.orm.em1_entity_listener_resolver')->isPublic()); |
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endmacro %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the final EOL
$output = str_replace(["\e[37m", "\e[0m", "\e[32;1m", "\e[34;1m"], "", $output); | ||
$this->assertContains("SELECT * FROM foo WHERE bar IN ('foo', 'bar');", $output); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing final EOL
Tests/ProfilerTest.php
Outdated
use Symfony\Component\HttpKernel\Profiler\Profile; | ||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | ||
|
||
class ProfilerTest extends \PHPUnit\Framework\TestCase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a use statement
65c663b
to
b1e881a
Compare
Hey guys! Do we need any more changes on this? I'm tracking to make sure we get a release and tag by next week. |
It's finished from my POV |
Let's please try to do the merge during this Symfony RC phase, so analogous patch for Doctrine bridge I will create can make it into 3.4 which will allow us to drop this workaround https://github.com/ostrolucky/DoctrineBundle/blob/b1e881aacb1af71293ceca13da852c01d9fc1afe/DataCollector/DoctrineDataCollector.php#L140-L149 when Symfony 2.* is EOL. If we won't make it, that workaround might have to stay there during whole life cycle of Symfony 3.4. |
@ostrolucky Unless it's a pretty serious/obvious bug fix, nothing at this point will make it into 3.4. So, I think that workaround will need to stay. But, no big deal. But yes, since this is broken in Symfony 4, I'd love to see a quick merge + tag so that (if there are any more issues), we can find them. |
Thanks @mikeSimonson! I already see a new 1.8.0 tag... but I think this isn't included in it? Is that correct? Could we create a 1.8.1 with this fix? |
@weaverryan done |
Doctrine profiler does not work in Symfony 4. This issue is completely ignored, so I had to give it a try. I have extended travis matrix to test Symfony 4 and fixed all Symfony 4 test failures.